<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>新建会议</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../../../static/layui/dist/layuiadmin/layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>


  
<!--<blockquote class="layui-elem-quote layui-text">-->
<!--  <h1>新建会议</h1>-->
<!--</blockquote>-->

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>基本信息</legend>
</fieldset>

<form class="layui-form" action="" method="POST" lay-filter="example">
  <div class="layui-form-item">
    <label class="layui-form-label">会议名称</label>
        <div class="layui-input-inline">
          <!-- <input type="password" name="password" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input"> -->
          <input type="text" name="meetname" lay-verify="title" autocomplete="off"  class="layui-input">
        </div>
      </div>

  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">发布者</label>
    <div class="layui-input-inline">
      <input type="text" name="bossname" lay-verify="title"  placeholder="请输入会议发布者姓名" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div clas="layui-form-item">
    <label class="layui-form-label">会议地点</label>
    <div class="layui-input-block"><!-- <div class="layui-inline">
      <label class="layui-form-label">验证日期</label>
      <div class="layui-input-inline">
          <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
      </div> -->

      <input type="text" name="place" lay-verify="required"  placeholder="请输入会议开始地点" autocomplete="off" class="layui-input" style="width: 300px;">
    </div>
  </div>





<!-- 示例-970 -->
<!-- <ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins> -->

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
  <legend>会议时间</legend>
</fieldset>

<!--<form class="layui-form" action="" method="POST" lay-filter="example">-->


  <div class="layui-form-item">
    <label class="layui-form-label">会议日期</label>
    <div class="layui-input-inline">
      <input type="text" name="date"  id='date' lay-verify="date" autocomplete="off" placeholder="请选择会议日期" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">开始时间</label>
    <div class="layui-input-inline">
      <input type="text" name="start_time"  id='test1' lay-verify="time" autocomplete="off" placeholder="请选择时间" class="layui-input">
    </div>
  </div>
  <!-- <div class="layui-form-item">
    <label class="layui-form-label">开始时间</label>
    <div class="layui-input-inline">
      <input type="text" class="layui-input" id="test1" placeholder="HH:mm:ss">
    </div>
  </div> -->
  <div class="layui-form-item">
    <label class="layui-form-label">结束时间</label>
    <div class="layui-input-inline">
      <input type="text" name="finish_time"  id='test2' lay-verify="time" autocomplete="off" placeholder="请选择时间" class="layui-input">
    </div>
  </div>
  <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>参会人员</legend>
  </fieldset>

  <div class="layui-form-item">
    <label class="layui-form-label">参会人员</label>
    <div class="layui-input-block">
      <select name="interest"  name='checkedLevel' lay-filter="aihao" multiple="multiple"
              style="width: 100px">
        <option value=""></option>
        <!-- <option value="0">写作</option>
        <option value="1" selected="">阅读</option>
        <option value="2">游戏</option>
        <option value="3">音乐</option>
        <option value="4">旅行</option> -->
      </select>
    </div>
  </div>
  <div class="layui-form-item">
      <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="userAdd">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
  </div>
</form>
<script src="../../../static/layui/dist/layuiadmin/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;

  //日期
  laydate.render({
    elem: '#date'
  });
  laydate.render({
    elem: '#date1'
  });


  //时间选择器
  laydate.render({
    elem: '#test1'
    ,type: 'time'

  });
  laydate.render({
    elem: '#test2'
    ,type: 'time'
  });
  lay('.test-laydate-item').each(function(){
      laydate.render({
        elem: this
        ,trigger: 'click'
      });
    });

  
 
// 设置默认选中
//$("select[name='column']").multipleSelect('setSelects', [1,2]);
  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');

  //自定义验证规则
  form.verify({
// <!--    title: function(value){-->
// <!--      if(value.length < 5){-->
// <!--        return '标题至少得5个字符啊';-->
// <!--      }-->
// <!--    }-->
    pass: [
      /^[\S]{6,12}$/
      ,'密码必须6到12位，且不能出现空格'
    ]
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });

  //监听指定开关
  form.on('switch(switchTest)', function(data){
    layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
      offset: '6px'
    });
    layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
  });

  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });

  //表单赋值
  layui.$('#LAY-component-form-setval').on('click', function(){
    form.val('example', {
      "username": "贤心" // "name": "value"
      ,"password": "123456"
      ,"interest": 1
      ,"like[write]": true //复选框选中状态
      ,"close": true //开关状态
      ,"sex": "女"
      ,"desc": "我爱 layui"
    });
  });
//   layui.$('#checkedLevel').multipleSelect({
//     addTitle: true, //鼠标点悬停在下拉框时是否显示被选中的值
//     selectAll: false, //是否显示全部复选框，默认显示
//     name: "质控级别",
//     selectAllText: "选择全部", //选择全部的复选框的text值
//     allSelected: "全部", //全部选中后显示的值
// //delimiter: ', ', //多个值直接的间隔符，默认是逗号
//    placeholder: "质控级别" //不选择时下拉框显示的内容
//   });
  //表单取值
  layui.$('#LAY-component-form-getval').on('click', function(){
    var data = form.val('example');
    alert(JSON.stringify(data));
  });

});
</script>
    <script>
      layui.use(['form', 'layedit', 'laydate'], function () {
          var form = layui.form
              , layer = layui.layer
              , layedit = layui.layedit
              , laydate = layui.laydate;

          //监听submit提交按钮 button ，lay-filter 为 userAdd 的
          form.on('submit(userAdd)', function (data) {
              //此段代码可以获取提交的数据
              var $ = layui.$
              //ajax 提交
              $.ajax({
                  type: "post",
                  dataType: "text",
                  url: "add_meet",//url
                  data: $('#popupForm').serialize(),  //表单数据
                  success: function (data) {
                      var _data = eval("(" + data + ")")
                      if (_data.state == 1) {
                          layer.msg('添加成功，1秒后自动关闭该窗口');
                          //延迟1秒执行，目的是让用户看到提示
                          setTimeout(function () {
                              //1、先得到当前iframe层（弹出层）的索引  ///2、提交成功关闭弹出层窗口
                              var index = parent.layer.getFrameIndex(window.name);
                              parent.layer.close(index);
                          }, 1 * 1000);
                      } else if (_data.state == 0) {
                          layer.msg('用户名已存在');
                      };
                  },
                  error: function () {
                  }
              });
              //阻止页面跳转
              return false;
          });

          //自定义表单验证
          //lay-verify ：对应userr、pass、等，required 为必填项
          form.verify({
              user_name: function (value) {
                  if (value.length < 2) {
                      return '用户名至少得2个字符啊';
                  }
              }
              , password: [
                  /^[\S]{6,12}$/
                  , '密码必须6到12位，且不能出现空格'
              ]
              , content: function (value) {
                  layedit.sync(editIndex);
              }
          });

      });
      // layui.use(['form', 'layedit', 'laydate'], function () {
      //     var form = layui.form
      //         , layer = layui.layer
      //         , layedit = layui.layedit
      //         , laydate = layui.laydate;

      //     //自定义表单验证
      //     //lay-verify ：对应userr、pass、等，required 为必填项
      //     form.verify({
      //         user: function (value) {
      //             if (value.length < 2) {
      //                 return '用户名至少得2个字符啊';
      //             }
      //         }
      //         , pass: [
      //             /^[\S]{6,12}$/
      //             , '密码必须6到12位，且不能出现空格'
      //         ]
      //         , content: function (value) {
      //             layedit.sync(editIndex);
      //         }
      //     });
      // });

  </script>
  <script>
    $("select[name='column']").multipleSelect({
      placeholder: "请选择",
      selectAllText:'全选',
      allSelected:'选择全部'
   });

  </script>
</body>
</html>